/*
 * @Description:
 * @Author: huiLong.lan
 * @Date: 2024-10-21 17:45:33
 * @LastEditors: huiLong.lan
 * @LastEditTime: 2024-10-21 17:45:38
 */
const express = require('express')

// 导入路由处理函数
const userHandler = require('../router_handel/userHandel')
// 创建路由模块
const router = express.Router()

// 1. 导入验证表单数据的中间件
const expressJoi = require('@escook/express-joi')

const { reg_login_schema } = require('../scheme/user.js')

// 注册新用户
router.post('/reguser', expressJoi(reg_login_schema), userHandler.userReguser)
// 登录
router.post('/login', expressJoi(reg_login_schema), userHandler.userLogin)

module.exports = router
